**********************************************************************************	
*** TABLE A2: Committees Holding Hearings on Improper Payments
**********************************************************************************

import delimited "$DATALOC/IP_hearings_agency_proquest.csv", varnames(1) clear

* contract to committee-hearing level

contract chamber cmt_govtrack hearingid
gen count_hearings = 1
collapse (sum) count_hearings, by(cmt_govtrack chamber)

* rename committees to modern names (to display in table)

gen committee = "Oversight and Accountability" if cmt_govtrack=="House Committee on Government Operations"
replace committee = "Ways and Means" if cmt_govtrack=="House Committee on Ways and Means"
replace committee = "Energy and Commerce" if cmt_govtrack=="House Committee on Interstate and Foreign Commerce"
replace committee = "Agriculture" if cmt_govtrack=="House Committee on Agriculture"
replace committee = "Veterans' Affairs" if cmt_govtrack=="House Committee on Veterans' Affairs"
replace committee = "Judiciary" if cmt_govtrack=="House Committee on Judiciary"
replace committee = "Small Business" if cmt_govtrack=="House Committee on Small Business"
replace committee = "Armed Services" if cmt_govtrack=="House Committee on Armed Services"
replace committee = "Education and the Workforce" if cmt_govtrack=="House Committee on Education and Labor"

replace committee = "Homeland Security and Governmental Affairs" if cmt_govtrack=="Senate Committee on Government Operations"
replace committee = "Finance" if cmt_govtrack=="Senate Committee on Finance"
replace committee = "Agriculture" if cmt_govtrack=="Senate Committee on Agriculture and Forestry"
replace committee = "Banking, Housing, and Urban Affairs" if cmt_govtrack=="Senate Committee on Banking, Housing, and Urban Affairs"

drop cmt_govtrack
gsort chamber -count_hearings
order chamber committee count_hearings

* Cells for Table A2 Committees Holding Hearings on Improper Payments
list if chamber=="House"
list if chamber=="Senate"
